<div class="form-group">
  <label for="name" class="control-label">Name</label>
  <input type="text" class="form-control" id="name" name="name" value="<%=h @query.attributes[:name] %>">
</div>
<div class="form-group">
  <label for="name" class="control-label">Namespaces</label>
  <select name="namespaces[]" id="namespaces-select" class="form-control select2" multiple="multiple">
    <% User.current.available_namespaces.each do |ns| %>
      <option value="<%=h ns %>" <%= 'selected="selected"' if @query.namespaces.include?(ns) %>><%=h ns %></option>
    <% end %>
  </select>
</div>
<div class="form-group">
  <label for="query" class="control-label">Query</label>
  <input type="text" class="form-control" id="query" name="query" value="<%=h @query.attributes[:query] %>">
</div>
